#include "forkos/types.h"
#include "forkos/kernel.h"
#include "forkos/multiboot.h"
#include "forkos/ega.h"

uint32_t kernel_error_code;
extern void _loop_of_death(void);

void kernel_panic(kernel_error_t code) {
    kernel_error_code = code;
    _loop_of_death();
}

void kernel_main(multiboot_boot_info_header_t *info) {
    ega_init();
    if (ega_get_error()) {
        kernel_panic(ERROR_EGA_INIT_FAILED); 
    }
    ega_print_string("Hello from forkOS\n", 0x1f);
    multiboot_traverse_info(info);

    ega_print_string("\n", 0x1f);
    kernel_panic(ERROR_OK);
} 